package com.biz.service.impl;

import com.biz.factory.*;
import com.biz.handler.*;
import com.biz.service.*;
import lombok.extern.slf4j.*;
import org.springframework.stereotype.*;

import javax.annotation.*;
import java.util.*;

/**
 * @Description
 *    数据归档服务类
 * @Author liuxi
 * @Date 2024/5/17
 **/
@Slf4j
@Service
public class BackUpServiceImpl implements BackUpDataService {

    @Resource
    private BackUpDataFactory backUpDataFactory;

    @Override
    public void backUpData(String scene) {
        log.info("BackUpServiceImpl.backUp.scene:{}!", scene);
        BackUpDataHandler backUpDataHandler = backUpDataFactory.getHandler(scene);
        if (Objects.isNull(backUpDataHandler)) {
            log.info("BackUpServiceImpl.noFindScene!");
            return;
        }
        backUpDataHandler.backUpData();
    }

}
